

using System;

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_Cos_RT : RT_Node
    {
        public RT_SingleValuePort Radian_RT;

        public RT_SingleValuePort Cos_RT;

        public Node_Cos_RT(Node_Cos sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            Radian_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Radian, this);

            Cos_RT = new RT_SingleValuePort(EPortIOType.Output, sourceData.Cos, this);
            Cos_RT.OnGetValue = GetCos;
        }

        public AValue GetCos(DAG_Executor executor)
        {
            float radian = Radian_RT.GetValue(executor).ToScalar().Item2;
            float result = MathF.Cos(radian);
            Cos_RT.SourceValue.SetScalar(result);
            return Cos_RT.SourceValue;
        }
    }
}